package com.whros.helloworld;

import com.whros.helloword.plugin.PluginInfo;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author whroid
 * @since 2021-07-25
 */
public class PluginManager {

    private Map<String, PluginInfo> pluginsMap = new ConcurrentHashMap<>();

    public void addPlugin(PluginInfo pluginInfo){
        pluginsMap.put(pluginInfo.getPluginName(), pluginInfo);
    }

    public void removePlugin(PluginInfo pluginInfo){
        pluginsMap.remove(pluginInfo.getPluginName());
    }

    public Map<String, PluginInfo> getPluginsMap() {
        return pluginsMap;
    }
}
